<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{margin: 0;padding: 0;}
        .father{
            font-size: 20px;
            /* 当设置具体值或者百分比的时候，子元素继承父类*/
            line-height: 200%;
        }
        .child{
            font-size: 16px;
            background-color: cadetblue;
        }
        .father2{
            margin-top: 10px;
            font-size: 20px;
            /* 当设置比例时候，子元素继承的就是自己本身的font-size和比例的乘积 */
            line-height: 2;
        }
        .child2{
            font-size: 16px;
            background-color: cadetblue;
        }
    </style>
</head>
<body>
    <div class="father">
        <div class="child">hello world</div>
    </div>
    <div class="father2">
        <div class="child2">hello world</div>
    </div>
</body>
</html>